<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<%@include file="frame/common.jsp"%>
	<title>API发布申请</title>
	<style>
		.applyinfo {
			padding: 20px 0;
		}

		.nav-tabs>li.active>a {
			background-color: #E6E5E5;
		}

		.form-horizontal .control-label {
			text-align: left;
		}

		.form-horizontal textarea {
			resize: none;
		}

		#tenantInfoTable table tbody tr td:nth-child(odd) {
			vertical-align: middle;
			text-align: center;
		}
		.bg-w {
			background-color:#fff;
			border-bottom-color:#fff;
		}
		.bg-w a {
			background-color:#fff !important;
			border-bottom-color:#fff !important;
		}
		body{
			font-size:16px;
		}
	</style>
	<script type="text/javascript">
        $(function() {
            //loadtenantType();
            validateForm();
        })

        function validateForm() {
            //debugger
            $("#seform").bootstrapValidator({
                fields : {
                    remark : {
                        validators : {
                            notEmpty : {
                                message : '请输入审批意见'
                            },
                            stringLength : {
                                min : 0,
                                max : 1024,
                                message : '请输入一个长度最多是 1024 的字符串'
                            }
                        }
                    }
                }
            });
        }


	</script>
</head>
<body>
<div class="content">
	<div class="container">
		<div class="row applyinfo">
			<div class="col-md-3">
				<label>标题：</label><span>API发布申请</span>
			</div>
			<div class="col-md-3">
				<label>申请时间：</label> <span id="apiApproveStartTime">
					<fmt:formatDate	type="date" value="${publish.apiApproveStartTime}"	dateStyle="default" />
					</span>
			</div>
			<%--<div>--%>
				<%--<label>当前审批人：</label>--%>
				<%--<span>--%>
						<%--<c:if test="${levelNum==1}">--%>
							<%--租户管理员--%>
						<%--</c:if>--%>
						<%--<c:if test="${levelNum==2}">--%>
							<%--运营管理员--%>
						<%--</c:if>--%>
					<%--</span>--%>
			<%--</div>--%>
		</div>
		<div>
			<!-- Nav tabs -->
			<ul class="nav nav-tabs" role="tablist">
				<li role="presentation" class="active bg-w">
					<a href="#home"	aria-controls="home" role="tab" data-toggle="tab">API审核查看</a>
				</li>
			</ul>

			<!-- Tab panes -->
			<div class="tab-content">
				<div role="tabpanel" class="tab-pane active" id="home">
					<table class="table table-bordered table-hover ">
						<thead>
						<tr>
							<th>API提供者</th>
							<th>API名称</th>
							<th>API版本</th>
							<th>上下文</th>
							<th>API层级</th>
							<th>协议</th>
							<th>生命周期修改者</th>
							<th>流程运行状态</th>
						</tr>
						</thead>
						<tr class="success">
							<th>${publish.providerName}</th>
							<th>${publish.apiName}</th>
							<th>${publish.version}</th>
							<th>${publish.context }</th>
							<th>${publish.tier}</th>
							<th>${publish.protocol}</th>
							<th>${publish.loginId}</th>
							<c:if test="${publish.apiApproveStatus==0}">
								<th>正在审核中</th>
							</c:if>
							<c:if test="${publish.apiApproveStatus==1}">
								<th>流程审核完成</th>
							</c:if>
							<c:if test="${publish.apiApproveStatus==2}">
								<th>一级审核不通过</th>
							</c:if>
							<c:if test="${publish.apiApproveStatus==3}">
								<th>一级审核已通过</th>
							</c:if>
							<c:if test="${publish.apiApproveStatus==4}">
								<th>二级审核不通过</th>
							</c:if>
							<c:if test="${publish.apiApproveStatus==5}">
								<th>二级审核已通过</th>
							</c:if>
						</tr>
					</table>

					<div>
						<label class="col-sm-2 control-label">历史审批意见：</label>
						<table class="table table-bordered table-hover">
							<thead>
							<tr>
								<th>提交人员</th>
								<th>提交时间</th>
								<th>是否同意</th>
								<th>处理意见</th>
							</tr>
							</thead>
							<tbody id="rowtbody2">
							<c:forEach items="${recordList }" var="record" >
								<tr class="success">
									<td>${record.approver}</td>
									<td><fmt:formatDate type="date" value="${record.createDate}"  pattern="yyyy-MM-dd HH:mm" /></td>
									<c:if test="${record.recordApproveStatus==1 }">
										<td>同意</td>
									</c:if>
									<c:if test="${record.recordApproveStatus==0 }">
										<td>不同意</td>
									</c:if>
									<td>${record.view }</td>
								</tr>
							</c:forEach>
							</tbody>
						</table>
					</div>


					<form class="form-horizontal" action="completeTask" id="seform" method="post">
						<input type="hidden" name="proInsId" value="${proInsId}" />
						<input type="hidden" name="taskId" value="${taskId}" />
						<input type="hidden" name="user" value="${loginUser}" />
						<input type="hidden" name="levelNum" value="${levelNum}" />
						<div class="form-group">
							<label class="col-sm-2 control-label">审批结果：</label>
							<div class="col-sm-10">
								<label class="radio-inline"> <input type="radio"
																	name="approvalSumup" id="yesRadio" value="1" checked>
									同意
								</label> <label class="radio-inline"> <input type="radio"
																			 name="approvalSumup" id="noRadio" value="0"> 不同意
							</label>
							</div>
						</div>
						<c:if test="${publish.secretData<2}">
							<div class="form-group">
								<label class="col-sm-2 control-label">是否包含隐私数据：</label>
								<div class="col-sm-10">
									<c:if test="${levelNum==0}">
										<c:if test="${publish.secretData==1}"><span name="secretData" value="1">包含</c:if>
										<c:if test="${publish.secretData==0}"><span name="secretData" value="0">不包含</span></c:if>
									</c:if>
									<c:if test="${levelNum>0}">
										<input type="radio" value="1" name="secretData" id="existSecretData" <c:if test="${publish.secretData==1}">checked="checked"</c:if>/>包含
										<input type="radio" value="0" name="secretData" id="notExistSecretData" <c:if test="${publish.secretData!=1}">checked="checked"</c:if>/>不包含
										<!--input type="hidden" id="secretData" name="secretData" value="${publish.secretData}" /-->
									</c:if>
								</div>
							</div>
						</c:if>

						<div class="form-group">
							<label class="col-sm-2 control-label">意见：</label>
							<div class="col-sm-12">
									<textarea class="form-control" rows="5" name="remark"
											  id="remark"></textarea>
							</div>
						</div>

						<div class="form-group">
							<div class="col-sm-offset-4 col-sm-1">
								<button type="submit" class="btn btn-primary" id="saveBtn">提交</button>
							</div>
							<div class="col-sm-offset-1 col-sm-1">
								<button type="button" class="btn btn-default"
										onclick="javascript:history.go(-1)">取消</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>